package com.dr.cmdb.core.errorcode;


import com.dr.cmdb.common.model.errorcode.Code;

/**
 *
 */
public enum BizCode implements Code {

    /**************************计费模块错误码******************************/
    FIELD_NOT_EXIST(20000, "字段不存在", "请检查参数"),
    FIELD_TYPE_ERROR(20001, "字段类型错误", "请检查参数"),
    EXPORT_FIELD_NOT_EXIST(20002, "表不存在导出字段", "请检查配置项信息"),
    REDIS_LOCK_FAILED(20003, "redis锁获取失败", "请稍后重试"),



    ;

    private final int code;
    private final String info;
    private final String fixTips;

    BizCode(int code, String info, String fixTips) {
        this.code = code;
        this.info = info;
        this.fixTips = fixTips;
    }

    /**
     * 错误码
     * eg: 200xx gateway
     * 300xx user
     * 400xx order
     * 500xx core
     * 600xx operator
     * 700xx admin
     * <p>
     * universal:
     * 10000 ~ 19999
     * 10000 success
     * 10001 system error
     * 10002 timed out
     * 10003 params error
     * 10004 rpc timeout
     * 10005 rpc invoke error
     *
     * @return
     */
    @Override
    public int getCode() {
        return this.code;
    }

    /**
     * 错误码说明(内部日志，统计，查看使用)
     *
     * @return
     */
    @Override
    public String getInfo() {
        return this.info;
    }

    /**
     * 错误码描述，对外输出
     *
     * @return
     */
    @Override
    public String getFixTips() {
        return this.fixTips;
    }
}
